home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / SASETUP.MSI / F77568_sh_tasks.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  21.8 KB  |  649 lines

  1. <%    '==================================================
  2.     ' Microsoft Server Appliance
  3.     '
  4.     ' sh_tasks - Implementation details for Tasks
  5.     '
  6.     ' Copyright (c) Microsoft Corporation.  All rights reserved.
  7.     '================================================== %>
  8. <!-- Copyright (c) Microsoft Corporation.  All rights reserved.-->
  9. <%
  10.  
  11.  
  12.     'Constants that are used in CreateColumnHTML
  13.     Const ONE_COLUMN = 1
  14.     Const TWO_COLUMNS = 2
  15.     Const MAX_COLUMNS = 3
  16.  
  17.     Const TASK_ONE_LEVEL    = 0
  18.     Const TASK_TWO_LEVEL    = 1
  19.     Const TASK_MANY_LEVEL = 2
  20.     Const TASK_RELATED_LEVEL = 3
  21.  
  22.  
  23.     Const EMBEDDED_PAGE = "FRAMESET"
  24.  
  25.     Dim g_sMultiTab
  26.     Dim g_sMultiTabContainer
  27.  
  28.     Dim g_sReturnURL
  29.  
  30. '----------------------------------------------------------------------------
  31. '
  32. ' Function : ServeTasks
  33. '
  34. ' Synopsis : Serves the task links
  35. '
  36. ' Arguments: None
  37. '
  38. ' Returns  : None
  39. '
  40. '----------------------------------------------------------------------------
  41. Public Function ServeTasks
  42.     Dim dwTaskType
  43.     Dim strContainer
  44.     Dim strContainerItem
  45.     Dim strTabsParam
  46.     
  47.     If Len(Trim(Request.QueryString("MultiTab"))) > 0 Then
  48.     
  49.         strContainer = Request.QueryString("MultiTab")
  50.         g_sMultiTab = strContainer
  51.         
  52.         strContainerItem = Request.QueryString("Container")
  53.         g_sMultiTabContainer = strContainerItem
  54.         
  55.         strTabsParam = "Tab1=" & GetTab1()
  56.         If ( Len(Trim(GetTab2())) > 0 ) Then
  57.             strTabsParam = strTabsParam & "&Tab2=" & GetTab2()
  58.         End If
  59.         dwTaskType = TASK_MANY_LEVEL
  60.             
  61.     Else
  62.  
  63.         strContainer = "TABS"
  64.         strContainerItem = GetTab1()
  65.         strTabsParam = ""    
  66.         If ( UCase("TabHome") = UCase(Request.QueryString("HOME")) ) Then
  67.             dwTaskType = TASK_ONE_LEVEL
  68.         Else
  69.             dwTaskType = TASK_TWO_LEVEL
  70.         End If
  71.     End If
  72.  
  73.     g_sReturnURL = Request.QueryString("ReturnURL")
  74.  
  75.     
  76.     Call SA_ServeTasks(strContainer, strContainerItem, dwTaskType, strTabsParam )
  77.  
  78.     If Len(Trim(g_sReturnURL)) > 0 Then    
  79.         Call SA_ServeBackButton(True, g_sReturnURL)
  80.     End If
  81.     
  82. End Function
  83.  
  84. Private Function IsHomeTask(ByVal dwTaskTYpe )
  85.     If ( dwTaskType = TASK_ONE_LEVEL ) Then
  86.         IsHomeTask = TRUE
  87.     Else
  88.         IsHomeTask = FALSE
  89.     End If
  90. End Function
  91.  
  92.  
  93. Private Function IsRelatedTask(ByVal dwTaskTYpe )
  94.     If ( dwTaskType = TASK_RELATED_LEVEL) Then
  95.         IsRelatedTask = TRUE
  96.     Else
  97.         IsRelatedTask = FALSE
  98.     End If
  99. End Function
  100.  
  101.  
  102. Public Function SA_ServeTasks(ByVal strContainerIn, ByVal strSelectedIDIn, ByVal dwTaskType, ByVal strTabParams )
  103.     on error resume next
  104.     
  105.     Err.Clear        
  106.     Dim colTabs
  107.     
  108.     ' the selected tab of interest
  109.     Dim sSelectedID
  110.     sSelectedID = strSelectedIDIn
  111.     
  112.     ' the element we're currently at
  113.     Dim sElementID
  114.         
  115.     ' the IWebElement object
  116.     Dim objElement
  117.     
  118.     ' the secondLevelContainer
  119.     Dim sContainer
  120.     Dim sDescriptionText
  121.     Dim sCaptionText 
  122.     Dim sElementGraphic
  123.     Dim sLongDescriptionText
  124.     
  125.     sContainer = ""
  126.  
  127.    
  128.     ' go through each element and output the tab link for them
  129.     Set colTabs = GetElements(strContainerIn)
  130.     For Each objElement In colTabs
  131.         sElementID = objElement.GetProperty("ElementID") 
  132.            If IsSameElementID(sElementID, sSelectedID) Then            
  133.                If ( Len(objElement.GetProperty("DescriptionRID")) > 0 ) Then
  134.                    sDescriptionText = GetLocalized(objElement.GetProperty("Source"), objElement.GetProperty("DescriptionRID"))
  135.                Else
  136.                    sDescriptionText = ""
  137.                End If
  138.                
  139.                If ( Len(objElement.GetProperty("LongDescriptionRID")) > 0 ) Then
  140.                    sLongDescriptionText = GetLocalized(objElement.GetProperty("Source"), objElement.GetProperty("LongDescriptionRID"))
  141.                Else
  142.                    sLongDescriptionText = ""
  143.                End If
  144.                
  145.             sCaptionText = GetLocalized(objElement.GetProperty("Source"), objElement.GetProperty("CaptionRID"))
  146.                If ( Err.Number <> 0 ) Then
  147.                    SA_TraceOut "SA_TASKS", "Invalid/Missing CaptionRID for ElementID: " + sElementID
  148.                End If
  149.                
  150.                Call GetBigGraphic( objElement, sElementGraphic, dwTaskType )
  151.  
  152.             Exit For
  153.            End If
  154.        Next ' objElement
  155.     Set colTabs = Nothing
  156.    
  157.     rw("<blockquote>")
  158.  
  159.     rw("<div class=TasksPageTitleText >" & sCaptionText & "</div>")
  160.     rw("<div class=TasksPageTitleDescription  >" & sLongDescriptionText & "</div><br>")
  161.  
  162.     'Check to see if the selectedID is a home page.
  163.     If ( IsHomeTask(dwTaskType) ) Then
  164.         Call ServeColumns( "TABS", False, sElementGraphic, dwTaskType, strTabParams )
  165.     Else
  166.         Call ServeColumns( sElementID, False, sElementGraphic, dwTaskType, strTabParams )
  167.     End If
  168.       
  169.     Call ServeColumns( sElementID&"_RelatedLinks", True, "" , TASK_RELATED_LEVEL, strTabParams )
  170.  
  171.     rw("</blockquote>") 
  172.  
  173. End Function
  174.  
  175.  
  176.  
  177. '----------------------------------------------------------------------------
  178. '
  179. ' Function : ServeColumns
  180. '
  181. ' Synopsis : Generates HTML columns.
  182. '
  183. ' Arguments: strItem(IN)     - if strItem is  "TABS", it'll display home page with all the TABS
  184. '                             - if strItem is "TASKS", it'll display all  the tasks in columns.
  185. '                             - if strItem is "DISKS_RELATEDLINKS", it'll display all the related links.
  186. '             bInRelated(IN)  - True, if this is a table that has related links
  187. '                             - False, if this is a table that is rendered for tasks.
  188. '            strElementGraphic(IN)   - resource dll for each tab string (array)
  189. '            bInWelcome(IN)  - True if we are rendering Welcome page, False otherwise.
  190. '
  191. ' Returns  : None
  192. '
  193. '----------------------------------------------------------------------------
  194.  
  195.  
  196. Sub ServeColumns( strItem, blnRelated, strElementGraphic, dwTaskType, strTabParams )
  197.     On Error Resume Next
  198.     Err.Clear
  199.     
  200.     Dim objElements, objItem
  201.     Dim intRowCount
  202.     Dim strArrTasksImage
  203.     Dim strArrTasksCaption
  204.     Dim strArrTasksHover
  205.     Dim strArrTasksDesc
  206.     Dim strArrTasksURL
  207.     Dim strArrSource
  208.     Dim bArrIsEmbedded
  209.     Dim strArrTaskPageType
  210.     Dim strArrTaskPageWindowFeatures
  211.     Dim intElementCount
  212.     Dim sReturnURL
  213.  
  214.     Dim bSmallIcon
  215.  
  216.     Dim i
  217.     Dim j
  218.     ' the big image on the left side when a tab is selected.
  219.     Dim bBigIcon
  220.     
  221.     intElementCount = 0
  222.     i = 0
  223.     j = 0
  224.  
  225.     Set objElements = GetElements( strItem )
  226.     intElementCount = objElements.Count
  227.  
  228.     ReDim strArrTasksImage( intElementCount )
  229.     ReDim strArrTasksCaption( intElementCount )
  230.     ReDim strArrTasksHover( intElementCount )
  231.     ReDim strArrTasksDesc( intElementCount )
  232.     ReDim strArrTasksURL( intElementCount )
  233.     ReDim strArrSource( intElementCount )
  234.     ReDim bArrIsEmbedded( intElementCount )
  235.     ReDim strArrTaskPageType( intElementCount )
  236.     ReDim strArrTaskPageWindowFeatures( intElementCount )
  237.  
  238.     If strElementGraphic = "" Then
  239.         bBigIcon = False
  240.     Else
  241.         bBigIcon = True
  242.     End If
  243.  
  244.     For Each objItem in objElements
  245.     
  246.         'SA_TraceOut "SA_TASKS", "ServeColumns elementID: " + objItem.GetProperty("ElementID")
  247.         strArrTaskPageType(i) = objItem.GetProperty("PageType")
  248.         strArrTaskPageWindowFeatures(i) = objItem.GetProperty("WindowFeatures")
  249.         
  250.         j = j + 1
  251.         
  252.         bArrIsEmbedded(i) = false
  253.         If objItem.GetProperty("IsEmbedded") = 1 Then
  254.             bArrIsEmbedded(i) = true
  255.         Else
  256.             Dim sPageType
  257.  
  258.             sPageType = objItem.GetProperty("PageType")
  259.             If ( UCase(sPageType) = EMBEDDED_PAGE ) Then
  260.                 bArrIsEmbedded(i) = true
  261.             End If            
  262.             
  263.         End If
  264.  
  265.         If ( Len(objItem.GetProperty("LongDescriptionRID")) > 0 ) Then
  266.             strArrTasksHover(i) = GetLocalized(objItem.GetProperty("Source"), objItem.GetProperty("LongDescriptionRID"))
  267.         Else
  268.             strArrTasksHover(i) = ""
  269.         End If
  270.         
  271.         If (Not IsHomeTask(dwTaskType)) Or ( objItem.GetProperty("ElementID") <> Request.QueryString("HOME") ) Then
  272.         
  273.             strArrSource( i ) = objItem.GetProperty("Source")
  274.             
  275.             Call GetSmallGraphic(objItem, strArrTasksImage(i) )
  276.  
  277.             If IsRawURLPage(sPageType) Then
  278.                 strArrTasksURL(i) = objItem.GetProperty("URL")
  279.             Else
  280.                 Select Case (dwTaskType)
  281.                     Case TASK_ONE_LEVEL
  282.                         strArrTasksURL(i) = objItem.GetProperty("URL")
  283.                         Call SA_MungeURL(strArrTasksURL(i), "Tab1", objItem.GetProperty("ElementID"))
  284.  
  285.                     Case TASK_TWO_LEVEL
  286.                         strArrTasksURL(i) = objItem.GetProperty("URL")
  287.                         If (strArrTasksURL(i) <> "") Then
  288.                             Call SA_MungeURL(strArrTasksURL(i), "Tab1", GetTab1())
  289.                             Call SA_MungeURL(strArrTasksURL(i), "Tab2", objItem.GetProperty("ElementID"))
  290.                             
  291.                             If ( true = bArrIsEmbedded(i) ) Then
  292.                                 'sReturnURL = m_VirtualRoot + "tasks.asp"
  293.                             Else
  294.                                 If Len(g_sReturnURL) > 0 Then
  295.                                     Call SA_MungeURL(strArrTasksURL(i), "ReturnURL", g_sReturnURL)
  296.                                 Else
  297.                                     sReturnURL = "tasks.asp"
  298.                                     Call SA_MungeURL(sReturnURL, "Tab1", GetTab1())
  299.                                     Call SA_MungeURL(sReturnURL, SAI_FLD_PAGEKEY, SAI_GetPageKey())
  300.                                     'Call SA_MungeURL(sReturnURL, "Tab2", objItem.GetProperty("ElementID"))
  301.                                     Call SA_MungeURL(strArrTasksURL(i), "ReturnURL", sReturnURL)
  302.                                 End If
  303.                             End If
  304.  
  305.                         End If
  306.  
  307.                     Case TASK_MANY_LEVEL
  308.                         strArrTasksURL(i) = objItem.GetProperty("URL")
  309.                         If (strArrTasksURL(i) <> "") Then
  310.                             If InStr(strArrTasksURL(i), "?") Then
  311.                                 strArrTasksURL(i) = strArrTasksURL(i) + "&"+ strTabParams
  312.                                 If ( true = bArrIsEmbedded(i) ) Then
  313.                                     'sReturnURL = m_VirtualRoot + "tasks.asp"
  314.                                 Else
  315.                                     sReturnURL = "tasks.asp"
  316.                                     Call SA_MungeURL(sReturnURL, "MultiTab", g_sMultiTab)
  317.                                     Call SA_MungeURL(sReturnURL, "Container", g_sMultiTabContainer)
  318.                                     Call SA_MungeURL(sReturnURL, "Tab1", GetTab1())
  319.                                     Call SA_MungeURL(sReturnURL, "Tab2", GetTab2())
  320.                                     Call SA_MungeURL(sReturnURL, "ReturnURL", g_sReturnURL)
  321.                                     Call SA_MungeURL(sReturnURL, SAI_FLD_PAGEKEY, SAI_GetPageKey())
  322.                                     Call SA_MungeURL(strArrTasksURL(i), "ReturnURL", sReturnURL)
  323.                                 End If
  324.                             Else
  325.                                 strArrTasksURL(i) = strArrTasksURL(i) + "?"+ strTabParams
  326.                                 If ( true = bArrIsEmbedded(i) ) Then
  327.                                     'sReturnURL = m_VirtualRoot + "tasks.asp"
  328.                                 Else
  329.                                     sReturnURL = "tasks.asp"
  330.                                     Call SA_MungeURL(sReturnURL, "MultiTab", g_sMultiTab)
  331.                                     Call SA_MungeURL(sReturnURL, "Container", g_sMultiTabContainer)
  332.                                     Call SA_MungeURL(sReturnURL, "Tab1", GetTab1())
  333.                                     Call SA_MungeURL(sReturnURL, "Tab2", GetTab2())
  334.                                     Call SA_MungeURL(sReturnURL, "ReturnURL", g_sReturnURL)
  335.                                     Call SA_MungeURL(sReturnURL, SAI_FLD_PAGEKEY, SAI_GetPageKey())
  336.                                     Call SA_MungeURL(strArrTasksURL(i), "ReturnURL", sReturnURL)
  337.                                 End If
  338.                             End If
  339.                         End If
  340.  
  341.                     Case TASK_RELATED_LEVEL
  342.                         strArrTasksURL(i) = objItem.GetProperty("URL")
  343.                     
  344.                     Case Else
  345.                         SA_TraceOut "SA_TASKS", "Unrecognized Task Option: " +CStr(dwTaskType)
  346.                         strArrTasksURL(i) = objItem.GetProperty("URL")
  347.                 
  348.                 End Select
  349.             End If
  350.             
  351.             If (0 = InStr(1, strArrTasksURL(i), ":")) Then
  352.                 Call SA_MungeURL(strArrTasksURL(i), SAI_FLD_PAGEKEY, SAI_GetPageKey())
  353.             End If
  354.             
  355.             strArrTasksCaption(i) = GetLocalized( strArrSource(i), objItem.GetProperty("CaptionRID") )
  356.             
  357.             If ( Len(objItem.GetProperty("DescriptionRID")) > 0 ) Then
  358.                 strArrTasksDesc(i) = GetLocalized( strArrSource(i), objItem.GetProperty("DescriptionRID") )
  359.             Else
  360.                 strArrTasksDesc(i) = ""
  361.             End If
  362.             
  363.             i = i + 1
  364.         Else
  365.             intElementCount = intElementCount - 1
  366.             Call GetSmallGraphic(objItem, strArrTasksImage(i) )
  367.         End If        
  368.     Next
  369.  
  370.     'Check if atleast one icon is represented,
  371.     bSmallIcon = CheckIfAtleastOneIconPresent( strArrTasksImage, intElementCount )
  372.  
  373.     If Not IsRelatedTask(dwTaskType) Then
  374.         If strElementGraphic = "" Then
  375.             rw ("<TABLE class=""TasksPageBodyTable"" WIDTH=""90%"" CELLPADDING=""10"" CELLSPACING=""0"" BORDER=""0""><TR> " )
  376.             Call CreateColumnHTML( intElementCount, strArrTasksImage, strArrTasksCaption, strArrTasksDesc, strArrTasksURL, strArrTasksHover, bArrIsEmbedded, bSmallIcon, bBigIcon, strArrTaskPageType, strArrTaskPageWindowFeatures )
  377.             rw ("</TABLE>")
  378.             
  379.         Else
  380.             rw ("<TABLE  WIDTH=""90%"" CELLPADDING=""0"" CELLSPACING=""0"" BORDER=""0""  >" )
  381.             'rw ("<TR><TD ROWSPAN=4 valign=""top""><img src=""" & strElementGraphic & """></TD>")
  382.             rw ("<TR><TD width=220px valign=""top""><img src=""" & strElementGraphic & """></TD><td valign=top>")
  383.             rw ("<TABLE class=""TasksPageBodyTable"" WIDTH=""100%"" CELLPADDING=""10"" CELLSPACING=""0"" BORDER=""0""  >" )
  384.             Call CreateColumnHTML( intElementCount,  strArrTasksImage, strArrTasksCaption, strArrTasksDesc, strArrTasksURL, strArrTasksHover, bArrIsEmbedded, bSmallIcon, bBigIcon, strArrTaskPageType, strArrTaskPageWindowFeatures )
  385.             rw ("</tr></table></TD></TR></TABLE>")
  386.         End If
  387.     ElseIf (intElementCount > 0) Then
  388.         rw("<br><div class=TasksPageLinkText>Related Links</div>")
  389.         rw ("<TABLE WIDTH=""90%"" CELLPADDING=""0"" CELLSPACING=""0"" BORDER=""1""><TR> " )
  390.         Call CreateColumnHTML( intElementCount,  strArrTasksImage, strArrTasksCaption, strArrTasksDesc, strArrTasksURL, strArrTasksHover, bArrIsEmbedded, bSmallIcon, bBigIcon, strArrTaskPageType, strArrTaskPageWindowFeatures )
  391.         rw ("</TD></TR></TABLE>")
  392.     End If
  393.  
  394. End Sub
  395.  
  396. '----------------------------------------------------------------------------
  397. '
  398. ' Function : CheckIfAtleastOneIconPresent
  399. '
  400. ' Synopsis : Checks if we need to allocate a column for small Icons with the tasks or related links table.
  401. '
  402. ' Arguments: strArrTasksImage(IN)   - resource dll for each tab string (array)
  403. '             intNumTasks(IN)        - Number of items in the above array.
  404. '
  405. '
  406. ' Returns  : None
  407. '
  408. '----------------------------------------------------------------------------
  409. Function CheckIfAtleastOneIconPresent( strArrTasksImage, intNumTasks)
  410.  
  411. Dim bIcon
  412. Dim intElCount
  413.  
  414.     bIcon = False
  415.     
  416.     'Check if there is atleast one icon
  417.     For intElCount = 0 to intNumTasks-1        
  418.         If strArrTasksImage(intElCount) <> "" Then
  419.             bIcon = True
  420.             Exit For
  421.         End If
  422.     Next
  423.  
  424.     CheckIfAtleastOneIconPresent=bIcon
  425.  
  426. End Function
  427.  
  428. '----------------------------------------------------------------------------
  429. '
  430. ' Function : CreateColumnHTML
  431. '
  432. ' Synopsis : Generates HTML to display the Items.
  433. '
  434. ' Arguments: intNumTasks(IN)        - number of Tasks to be displayed
  435. '            strArrTasksImage(IN)   - resource dll for each tab string (array)
  436. '            strArrTasksCaption(IN) - text on task (array)
  437. '            strArrTasksDesc(IN)    - Description for each task(array)
  438. '             strArrTasksURL(IN)     - URL for each task ( array )
  439. '            bArrIsEmbedded(IN)     - if URL is embedded, use OpenPage() to link to it
  440. '             bSmallIcon                - True if there is atleast one image so 
  441. '                                        we can allocate a column for small images, otherwise false.
  442. '             bBigIcon                - True if the big image exists that is to be displayed on the left col
  443. '                                        otherwise false.
  444. '
  445. '
  446. ' Returns  : None
  447. '
  448. '----------------------------------------------------------------------------
  449.  
  450. Sub CreateColumnHTML(intNumTasks, strArrTasksImage, strArrTasksCaption, strArrTasksDesc, strArrTasksURL, strArrTasksHover, bArrIsEmbedded, bSmallIcon, bBigIcon, strArrTaskPageType, strArrTaskPageWindowFeatures )
  451.  
  452. Dim i
  453.  
  454.  
  455. 'URL of the web element
  456. Dim strURL
  457.  
  458. ' Number of columns
  459. Dim intCols
  460. Dim intWidth
  461. Dim sLongDescriptionText
  462. Dim sTaskTitle
  463.  
  464.     If ( intNumTasks < 4 ) Then
  465.         intCols = ONE_COLUMN
  466.         intWidth=100
  467.     Elseif (intNumTasks <= 6) Then
  468.         intCols = TWO_COLUMNS
  469.         intWidth=50
  470.     Else
  471.         ' Since the small icon takes a col, we need to subtract 1 from max cols.
  472.         If bBigIcon Then
  473.             intCols = MAX_COLUMNS - 1
  474.             intWidth=50
  475.         Else
  476.             intCols = MAX_COLUMNS
  477.             intWidth=33
  478.         End If
  479.     End If
  480.  
  481.     For i = 0 to intNumTasks-1        
  482.  
  483.         sLongDescriptionText = strArrTasksHover(i)
  484.  
  485.         ' Close the row and open a new row
  486.         If ( i<>0 And i mod intCols = 0 ) Then
  487.             rw ("</tr><tr valign=top>")
  488.         End If
  489.         
  490.         'If atleast one icon is represented show the image column otherwise skip this column
  491.            sTaskTitle = strArrTasksCaption(i)
  492.         If bSmallIcon Then
  493.             If bArrIsEmbedded(i) Then
  494.                 strURL = "javascript:OpenPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i) & "', location.href, '" & SA_EncodeQuotes(sTaskTitle) & "');"
  495.             ElseIf ( Len(Trim(strArrTaskPageType(i))) > 0 ) Then
  496.                 Select Case UCase(Trim(strArrTaskPageType(i)))
  497.                     Case "NORMAL"
  498.                         strURL = "javascript:OpenNormalPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i)  & "');"
  499.                     Case "FRAMESET"
  500.                         strURL = "javascript:OpenPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i) & "', location.href, '" & SA_EncodeQuotes(sTaskTitle) & "');"
  501.                     Case "NEW"
  502.                         strURL = "javascript:OpenNewPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i) & "', '" & strArrTaskPageWindowFeatures(i) & "');"
  503.                     Case "RAW"
  504.                         strURL = "javascript:OpenRawPageEx('" & strArrTasksURL(i) & "', '" & strArrTaskPageWindowFeatures(i) & "');"
  505.                     Case Else
  506.                         SA_TraceOut "SH_TASKS", "Invalid Task PageType: " + strArrTaskPageType(i)
  507.                         strURL = strArrTasksURL(i)
  508.                 End Select
  509.             Else
  510.                 strURL = "javascript:OpenNormalPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i)  & "');"
  511.             End If
  512.  
  513.             If strArrTasksImage(i) <> "" And strArrTasksURL(i) <> "" Then
  514.                 strURL = " onClick=""" + strURL + """ "
  515.                 Response.Write("<TD WIDTH=20 valign=top>"+vbCrLf)
  516.                 Response.Write("<SPAN ID='TaskItemImage_"+CStr(i)+"' "+vbCrLf)
  517.                 Response.Write( strURL + vbCrLf )
  518.                 Response.Write(" title="""+Server.HTMLEncode(sLongDescriptionText)+""" ")
  519.                 Response.Write(" class='TasksPageLinkText' ")
  520.                 Response.Write(" onmouseover=""this.className='TasksPageLinkTextHover'; return true;"" ")
  521.                 Response.Write(" onmouseout=""this.className='TasksPageLinkText'; return true;"" ")
  522.                 Response.Write(" >")
  523.                 Response.Write("<IMG SRC=" & strArrTasksImage(i))
  524.                 Response.Write(" BORDER=""0"" ></TD>" +vbCrLf)
  525.                 Response.Write("</SPAN>"+vbCrLf)
  526.                 Response.Write("</TD>"+vbCrLf)
  527.             Else
  528.                 rw ( "<TD valign=""top"">")
  529.                 Response.Write("<SPAN ID='TaskItemImage_"+CStr(i)+"'>"+vbCrLf)
  530.                 Response.Write("</SPAN>"+vbCrLf)
  531.                 rw ( "</TD>")
  532.             End If
  533.         End If
  534.  
  535.         ' If the URL is not empty then the task is clickable otherwise using a DIV tag
  536.         sTaskTitle = strArrTasksCaption(i)
  537.         If (strArrTasksURL(i) <> "") Then
  538.             If bArrIsEmbedded(i) Then
  539.                 strURL = "javascript:OpenPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i) & "', location.href, '" & SA_EncodeQuotes(sTaskTitle) & "');"
  540.                 strURL = " onClick=""" + strURL + """ "
  541.             ElseIf ( Len(Trim(strArrTaskPageType(i))) > 0 ) Then
  542.                 Select Case UCase(Trim(strArrTaskPageType(i)))
  543.                     Case "NORMAL"
  544.                         strURL = "javascript:OpenNormalPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i)  & "');"
  545.                     Case "FRAMESET"
  546.                         strURL = "javascript:OpenPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i) & "', location.href, '" & SA_EncodeQuotes(sTaskTitle) & "');"
  547.                     Case "NEW"
  548.                         strURL = "javascript:OpenNewPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i) & "', '" & strArrTaskPageWindowFeatures(i) & "');"
  549.                     Case "RAW"
  550.                         strURL = "javascript:OpenRawPageEx('" & strArrTasksURL(i) & "', '" & strArrTaskPageWindowFeatures(i) & "');"
  551.                     Case Else
  552.                         SA_TraceOut "SH_TASKS", "Invalid Task PageType: " + strArrTaskPageType(i)
  553.                         strURL = strArrTasksURL(i)
  554.                 End Select
  555.                 strURL = " onClick=""" + strURL + """ "
  556.             Else
  557.                 strURL = "javascript:OpenNormalPage('" & m_VirtualRoot & "', '" & strArrTasksURL(i)  & "');"
  558.                 strURL = " onClick=""" + strURL + """ "
  559.             End If
  560.             
  561.             Response.Write("<TD valign=top width='" + CStr(intWidth) + "%'>"+vbCrLf)
  562.             Response.Write("<SPAN ID='TaskItemText_"+CStr(i)+"' "+vbCrLf)
  563.             Response.Write( strURL + vbCrLf )
  564.             Response.Write(" title=""" + Server.HTMLEncode(sLongDescriptionText) + """ ")
  565.             Response.Write(" class='TasksPageLinkText' ")
  566.             Response.Write(" onmouseover=""this.className='TasksPageLinkTextHover'; return true;"" ")
  567.             Response.Write(" onmouseout=""this.className='TasksPageLinkText'; return true;"" ")
  568.             Response.Write(" >")
  569.             Response.Write( strArrTasksCaption(i) )
  570.             Response.Write( "<div class=TasksPageText>" & strArrTasksDesc(i) )
  571.             Response.Write( "</div></TD>" +vbCrLf )
  572.             Response.Write("</SPAN>"+vbCrLf)
  573.             Response.Write("</TD>"+vbCrLf)
  574.             
  575.         Else
  576.             Response.Write("<TD valign=top width='"+CStr(intWidth)+"%' >"+vbCrLf)
  577.             Response.Write("<SPAN ID='TaskItemText_"+CStr(i)+"' "+vbCrLf)
  578.             rw ( " title="""+Server.HTMLEncode(sLongDescriptionText)+""" > " & "<div class=TasksPageLinkText>" &strArrTasksCaption(i) & "</div><div class=TasksPageText>" & strArrTasksDesc(i) & "</div>" )
  579.             Response.Write("</SPAN>"+vbCrLf)
  580.             Response.Write("</TD>"+vbCrLf)
  581.         End If
  582.  
  583.         
  584.     Next
  585.  
  586. End Sub
  587.  
  588.  
  589. Function GetBigGraphic(ByRef objElement, ByRef strGraphicElement, dwTaskType )
  590.     Err.Clear
  591.     on error resume next
  592.  
  593.     dim strURL
  594.     strURL=objElement.GetProperty("URL")
  595.  
  596.     If ( IsObject(objElement)) Then
  597.         strGraphicElement = objElement.GetProperty("BigGraphic")
  598.         ' Show the small graphic for two level tabs only
  599.         If Err.Number <> 0 Or Instr( 1, strURL, "MultiTab",0 ) > 0 And dwTaskType = TASK_TWO_LEVEL Then            
  600.             strGraphicElement = objElement.GetProperty("ElementGraphic")
  601.         End If
  602.     Else
  603.         SA_TraceErrorOut "TASKS", "objElement is not an object"
  604.     End If
  605.  
  606.     If ( Len(strGraphicElement) > 0 ) Then
  607.         strGraphicElement = m_VirtualRoot + strGraphicElement
  608.     End If
  609. End Function
  610.  
  611.  
  612. Function GetSmallGraphic(ByRef objElement, ByRef strGraphicElement )
  613.     Err.Clear
  614.     on error resume next
  615.  
  616.     If ( IsObject(objElement)) Then
  617.         strGraphicElement = objElement.GetProperty("ElementGraphic")
  618.         If (Err.Number<>0) Then
  619.             strGraphicElement = ""
  620.         End If
  621.     Else
  622.         SA_TraceErrorOut "TASKS", "objElement is not an object"
  623.     End If
  624.  
  625.     If ( Len(strGraphicElement) > 0 ) Then
  626.         strGraphicElement = m_VirtualRoot + strGraphicElement
  627.     End If
  628. End Function
  629.  
  630. Function IsRawURLPage(ByVal pageType)
  631.     IsRawURLPage = FALSE
  632.     
  633.     If ( UCase(pageType) = "RAW" ) Then
  634.         IsRawURLPage = TRUE
  635.     End If
  636.  
  637. End Function
  638.  
  639. %>
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.         
  647.                 
  648.             
  649.